import React, { useContext, useState } from "react"
import NavBar from './NavBar.tsx'
import MenuBar from "./MenuBar.tsx"

 // 共享状态钩子
 const AppContext = React.createContext({})

// 钩子一律使用use前缀命名
const HomePage = () => {

    // 状态钩子，状态初始值
    const [buttonText, setButtonText] = useState("Click")

    const handleClick = () => {
        return setButtonText("Clicked")
    }

    

    return (
        <div>
            <NavBar />
            <MenuBar />
            <div onClick={handleClick}>首页{buttonText}</div>
            <AppContext.Provider value={{ username: 'doge' }}>
                
            </AppContext.Provider>
        </div>
    )
}

export default HomePage